<form id="<?php echo $uniqid;?>" method="post" style="padding: 0;">
  <table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable" style="margin-bottom: 100px;">
    <tr bgcolor="#FFFFFF">
      <td colspan="2" class="tlabel" style="text-align: left"><b>基础设置</b></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td class="tlabel" >{{params.merchant_order_settlement_cycle.title}}：</td>
      <td>
        <el-input-number :controls="false" size="small" v-model="params.merchant_order_settlement_cycle.value" :precision="0" :min="0">
        </el-input-number>
        <div class="title-tip">单位为天，如数值为N，则第N+1天完成结算，0为立即结算</div>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td class="tlabel" >{{params.merchant_platform_cut_ratio.title}}：</td>
      <td>
        <el-input-number :controls="false" size="small" v-model="params.merchant_platform_cut_ratio.value" :precision="2" :min="0" :max="100">
        </el-input-number>
        <div class="title-tip">数值比例为百分比，精确到2位小数</div>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td class="tlabel" >{{params.merchant_withdraw_fee_ratio.title}}：</td>
      <td>
        <el-input-number :controls="false" size="small" v-model="params.merchant_withdraw_fee_ratio.value" :precision="3" :min="0" :max="100"></el-input-number>
        <div class="title-tip">数值比例为百分比，精确到3位小数</div>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td class="tlabel" >{{params.merchant_withdraw_type.title}}：</td>
      <td>
        <el-checkbox-group v-model="params.merchant_withdraw_type.value">
          <el-checkbox v-for="type in params.merchant_withdraw_type.items" :label="type" :key="type">{{type}}</el-checkbox>
        </el-checkbox-group>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td class="tlabel" >{{params.merchant_withdraw_bank.title}}：</td>
      <td style="padding: 5px 100px 5px 15px;">
        <el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入可提现的银行" v-model="params.merchant_withdraw_bank.value"></el-input>
        <div class="title-tip">多个使用英文逗号隔开</div>
      </td>
    </tr>
  </table>
  <div style="position:absolute;z-index: 9999; bottom:0;width:100%; text-align:right; background-color:#F1f1f1; border:#ccc 1px solid;">
    <div style="padding:2px 15px 2px 10px; float:right;">
      <a href="javascript:void(0);" class="l-btn l-btn-small" @click="submit"><span
              class="l-btn-left l-btn-icon-left"><span class="l-btn-text">保存</span><span
              class="l-btn-icon icon-ok">&nbsp;</span></span></a>
      <a href="javascript:void(0);" class="l-btn l-btn-small" @click="close"><span
              class="l-btn-left l-btn-icon-left"><span class="l-btn-text">关闭</span><span
              class="l-btn-icon icon-no">&nbsp;</span></span></a>
    </div>
  </div>
</form>
<script>
  var dianpuconfigVm = new Vue({
    el: '#<?php echo $uniqid;?>',
    data: {
      params: JSON.parse('<?php echo addslashes($dataset);?>'),
      detail: {
        merchant_platform_cut_ratio:'0.00',
        merchant_withdraw_fee_ratio:'0.000',
        merchant_withdraw_type:[],
        merchant_withdraw_bank:'',
        merchant_order_settlement_cycle:0,
      },
    },
    created(){
    },
    methods: {
      submit: function () {
        this.detail.merchant_platform_cut_ratio = this.params.merchant_platform_cut_ratio.value;
        this.detail.merchant_withdraw_fee_ratio = this.params.merchant_withdraw_fee_ratio.value;
        this.detail.merchant_withdraw_type = this.params.merchant_withdraw_type.value;
        this.detail.merchant_withdraw_bank = this.params.merchant_withdraw_bank.value;
        this.detail.merchant_order_settlement_cycle = this.params.merchant_order_settlement_cycle.value;
        $.post('/admin/dianpu_config/config', dianpuconfigVm.detail, function (data) {
          if (data.ret === 0) {
            $.messager.show({
              title: '提示',
              msg: data.msg,
              timeout: 3000,
              showType: 'slide'
            });
            $('#<?php echo $uniqid;?>').form('clear');
            $('#rightTabs').tabs('close', '店铺设置');
          } else {
            $.messager.alert('提示', data.msg, 'warning');
          }
        }, 'json');
      },
      close(){
        $('#rightTabs').tabs('close', '店铺设置');
      }
    }
  });
</script>

<style>
  .become_register_delete {
    color: #FF5959;
    cursor: pointer;
  }
  .shopro-goods-id {
    width: 5%;
    padding: 0 10px;
    text-align: center;
    flex-shrink: 0;
  }
  .shopro-goods-header {
    height: 40px;
    display: flex;
    align-items: center;
    background: #f9f9f9;
  }

  .shopro-goods-body {
    height: 50px;
    display: flex;
    align-items: center;
    border-top: 1px solid #e6e6e6;
  }

  .shopro-goods-title {
    width: 65%;
    min-width: 280px;
    display: flex;
    height: 50px;
    align-items: center;
    overflow: hidden;
    padding: 0 20px;
  }

  .shopro-goods-stock {
    width: 15%;
    min-width: 100px;
  }

  .shopro-goods-opt {
    width: 20%;
    min-width: 100px;
  }

  .shopro-goods-image {
    width: 36px;
    height: 36px;

    border: 1px solid #E6E6E6;
    box-sizing: border-box;
    border-radius: 2px;
    margin-right: 12px
  }

  .shopro-goods-add-button {
    cursor: pointer;
    color: #7438D5;
    font-size: 13px;
    height: 50px;
    line-height: 50px;
    padding: 0 20px;
  }

  .shopro-goods-add-button i {
    margin-right: 6px;
  }
  .goods-add {
    width: 80px;
    height: 30px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    background: #7438D5;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
  }
</style>